<?php


namespace app\controller;


class TaskAlert extends BackendController{
    protected $model = null;
    protected $noNeedRight=['*'];
    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\model\TaskAlert();
    }

    public function after_index($lists) {
        foreach ($lists as &$list){
            /*$push_info=\app\model\MqttFacePushInfo::find($list['mqtt_face_push_info_id']);
            if($push_info){
                $face=\app\model\Faces::where('face_id',$push_info['face_id'])->find();
                $list['device_id']=$face['device_id'];
                $list['image_path']=$face['file_path'];
                $list['image_id']=$face['id'];
                $list['scores']=$face['scores'];
                $list['device_name']=$face['device_name'];
                $list['push_info']=$push_info;
            }*/
            if(isset($list['face_id'])){
                $list['face']=\app\model\Faces::find($list['face_id']);
            }
            if(isset($list['photo_id'])){
                $list['photo']=\app\model\AlbumPhoto::find($list['photo_id']);
            }

        }
        return $lists;
    }
}